/**
 *  @file SDLMenuSection.h
 *
 *  @date 23-nov-2009
 *  @author Ives van der Flaas
 */

#ifndef SDLMENUSECTION_H_
#define SDLMENUSECTION_H_

#include <SDL.h>
#include <vector>
#include <tr1/memory>
#include "SDLApplicationSection.h"
#include "SDLImageRepresentation.h"
#include "SDLButton.h"


namespace si_sdl
{
/**
 * Menu section that has buttons and such. This includes the options screen where
 * sound can be turned on and off.
 */
class SDLMenuSection: public si_sdl::SDLApplicationSection
{
public:
	SDLMenuSection(SDLApplication& parent, SDLWindow& win);
	virtual ~SDLMenuSection();

	virtual void newFrame(double time);
	virtual void onSDLEvent(SDL_Event &event);
	void alignButtons();

	virtual void youreStarting();

private:
	void addButton(SDLButton& but);
	virtual void processButtonClick(ButtonID sender);


	std::vector< std::tr1::shared_ptr<SDLButton> > fButtons;

	std::tr1::shared_ptr<SDLImageRepresentation> fBanner;

	ButtonID fPlayGameButton;
	ButtonID fOptionsButton;
	ButtonID fHighscoresButton;
	ButtonID fQuitButton;
	ButtonID fMusicOn;
	ButtonID fMusicOff;
	ButtonID fBack;

};

}

#endif /* SDLMENUSECTION_H_ */
